package main

import ("fmt"
	"time"
)

func main()  {
	//p:=Person{23,"hauzi"}
	//p.eat()
	//fmt.Println(p.name)

	go say("吃饭")
	say("睡觉")
	//
	////time.Sleep(time.Second * 3)
	//go hello()
	//hello()
	a:=[3]int{1,2,3}
	ints:= sum(a)
	fmt.Println(ints)
	fmt.Println(a)
}

type dongzuo interface {
	eat()
	run()
}
type Person struct {
	age int
	name string
}

func (p *Person)eat()  {
	fmt.Println("人要吃饭")
	fmt.Println(p.name)
	p.name="111"
	fmt.Println(p.name)
}
func (p *Person)run()  {
     fmt.Println("人妖跑步")
     fmt.Println(p.age)
}

func say(s string)  {
	for i:=0;i<5;i++{
		time.Sleep(100 * time.Millisecond)
		fmt.Println(s)
	}
}
func hello() {
	fmt.Println("Hello Goroutine!")
}
func sum(arr [3]int) [3]int {
	arr[1]=2222
	return arr

}